001 /* 002 * Copyright 2006 Stephen McConnell. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package net.dpml.http; 017 018 import java.util.Map; 019 020 import org.mortbay.jetty.handler.ErrorHandler; 021 022 /** 023 * Common http context handler context contract. 024 * @author <a href="http://www.dpml.net">Digital Product Meta Library</a> 025 * @version 0.0.0 026 */ 027 public interface ContextHandlerContext 028 { 029 /** 030 * Get the array of virtual hosts. 031 * @param hosts the default virtual host array 032 * @return the resolved virtual host array 033 */ 034 String[] getVirtualHosts( String[] hosts ); 035 036 /** 037 * Get the array of connectors. The function returns the set of 038 * connectors in the form <tt>host:port</tt>. 039 * @param connectors the default connector array 040 * @return the resolved host array 041 */ 042 String[] getConnectors( String[] connectors ); 043 044 /** 045 * Get the array of welcome files. 046 * @param values the default welcome file values 047 * @return the resolved array of welcome files 048 */ 049 String[] getWelcomeFiles( String[] values ); 050 051 /** 052 * Get the classloader to assign to the context handler. 053 * @param classloader the default classloader 054 * @return the resolved classloader 055 */ 056 ClassLoader getClassLoader( ClassLoader classloader ); 057 058 /** 059 * Get the context path under which the http context instance will 060 * be associated. 061 * 062 * @return the assigned context path 063 */ 064 String getContextPath(); 065 066 /** 067 * Get the context handler display name. 068 * @param name the default name 069 * @return the resolved name 070 */ 071 String getDisplayName( String name ); 072 073 /** 074 * Get the mime type mapping. 075 * @param map the default value 076 * @return the resolved value 077 */ 078 Map getMimeTypes( Map map ); 079 080 /** 081 * Get the assigned error handler. 082 * @param handler the default handler 083 * @return the resolved handler 084 */ 085 ErrorHandler getErrorHandler( ErrorHandler handler ); 086 }